PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Print

Print is an application command that prints one or more objects.

SYNTAX
print referenceToObject
PARAMETER
referenceToObject
A reference to the object or objects to print--typically one or more files, documents, or windows. Class: Reference or list of references
RESULT

None

EXAMPLES

Print an open document:

tell application "Apple System Profiler"
    print report "Control Panel Report"
end tell

The next script tells the Finder to print two AppleWorks documents. This is the equivalent of selecting the two documents in the Finder and choosing Print from the File menu.

tell application "Finder"
    print {file "Hard Disk:Letters:Offer", ¬
        file "Hard Disk:Letters:Acceptance"}
end tell
NOTES

To specify the name of a file to print, use the term file or alias followed by a string of the form " Disk : Folder1 : Folder2 :...: Filename " ; for details, see References to Files. You can also specify a string with only a filename (" Filename "). In this case, the application attempts to find the file in the current directory. (The current directory is typically the directory where the application was launched, the directory where the application last opened or saved a previous document, or another directory specified by the application. The current directory may be affected by settings in the General Controls control panel.)


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)